<?php
	$cfg = include_once("../../../config/config.php");
	$curl = "http://".$_SERVER["HTTP_HOST"].$_SERVER['PHP_SELF'];
	$curl = explode('themes',$curl);
	$curl = $curl[0];
	$host = $curl;
	if($cfg['router']==1){
		$curl .= "index.php?mod=admin&act=upload&mth=setIMG";
	}else if($cfg['router']==2){
		$curl .= "index.php/admin/upload/mth_setIMG".$cfg["url_suffix"];
	}else{
		$curl .= "?/admin/upload/mth_setIMG".$cfg["url_suffix"];
	}
?>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
<meta http-equiv="expires" content="0">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script>
	function showContent(val,id){
		if(val){
			if(id == 'bd'){
				document.getElementById("wl").checked = false;
			}else{
				document.getElementById("bd").checked = false;
				document.getElementById("bd_tr").style.display = "none";
			}
			document.getElementById(id+"_tr").style.display = "block";
		}
	}
</script>
<table style="font-size:12px;width:500px" align=center >

	<tr>
		<td width="100">本地图片:</td>
		<td align=left><input type="checkbox" name="bd" id="bd" onclick="showContent(this.value,'bd')" /></td>
	</tr>
	<tr>
		<td >网络图片:</td>
		<td align=left><input type="checkbox" checked name="wl" id="wl" onclick="showContent(this.value,'wl')"/></td>
	</tr>
	<tr id="wl_tr" >
		<td >图片地址</td>
		<td align=left><input id="IMGURL" /></td>
	</tr>
	<tr id="bd_tr" style="display:none">
		<td >本地上传</td>
		<td align=left>
			<iframe ID="Editor" name="Editor" src="<?=$curl?>" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:22px;width:100%"></iframe>
		</td>
	</tr>
	<tr>
		<td ></td>
		<td align=left><input type="button" value=" 确 定 " onclick="Success()" /></td> 
	</tr>
</table>
<script language=JavaScript>
<!-- 
function M(color) {
    window.returnValue = color;
    window.close();
}
function Success(){
	var img = document.getElementById("IMGURL").value;
	if(img!=""){
		M(img);
	}else{
		alert("请输入图片地址或上传!");
	}
}
function setIMG(picURL){
	document.getElementById("IMGURL").value='<?php echo $host."upload/";?>'+picURL;
}
-->
</script>